Efficient Local Unfolding with Ancestor Stacks for Full Prolog

نویسندگان

  • Germán Puebla
  • Elvira Albert
  • Manuel V. Hermenegildo
چکیده

Abs t r ac t . The integration of powerful partial evaluation methods into practical compilers for logic programs is still far from reality. This is related both to 1) efficiency issues and to 2) the complications of dealing with practical programs. Regarding efnciency, the most successful unfolding rules used nowadays are based on structural orders applied over (covering) ancestors, i.e., a subsequence of the atoms selected during a derivation. Unfortunately, maintaining the structure of the ancestor relation during unfolding introduces significant overhead. We propose an efficient, practical local unfolding rule based on the notion of covering ancestors which can be used in combination with any structural order and allows a stack-based implementation without losing any opportunities for specialization. Regarding the second issue, we propose assertion-based techniques which allow our approach to deal with real programs that include (Prolog) built-ins and external predicates in a very extensible manner. Finally, we report on our implementation of these techniques in a practical partial evaluator, embedded in a state of the art compiler which uses global analysis extensively (the Ciao compiler and, specifically, its preprocessor CiaoPP). The performance analysis of the resulting system shows that our techniques, in addition to dealing with practical programs, are also significantly more efficient in time and somewhat more efficient in memory than traditional tree-based implementations.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Efficient local unfolding with ancestor stacks

1 I n t r o d u c t i o n The main purpose of partial evaluation (see (Jones et al. 1993) for a general text on the área) is to specialize a given program w.r.t. par t of its input data—henee it is also known as program specialization. Essentially, partial evaluators are nonstandard interpreters which evalúate expressions while enough information is available and residualize them otherwise. The...

متن کامل

An Automatic Partial Evaluator for Full Prolog

A partial evaluator for Prolog takes a program and a query and returns a program specialized for all instances of that query. The intention is that the generated program will execute more efficiently than the original one for those instances. This thesis presents “Mixtus”, an automatic partial evaluator for full Prolog, i.e. including non-logical features such as cut, assert, var, write etc. Mi...

متن کامل

Near-horn Prolog and the Ancestry Family of Procedures Near-horn Prolog and the Ancestry Family of Procedures

The Near-Horn Prolog procedures have been proposed as eeective procedures in the area of disjunctive logic programming, an extension of logic programming to the ((rst-order) non-Horn clause domain. In this paper, we show that these case-analysis based procedures may be viewed as members of a class of procedures called the \an-cestry family," which also includes Model Elimination (and its varian...

متن کامل

The Need for Ancestor Resolution When Answering Queries in Horn Clause Logic

Prolog Technology Theorem Proving. (PTTP) [5] is a well known extension of Prolog for answering queries in first-order logic. PTTP is based on the idea that ‘Prolog can be viewed as an “almost complete” theorem prover, which has to be extended by only a few ingredients in order to handle the non-Horn case’ [1]. As explained in [5], PTTP is an efficient realisation of the Model Elimination (ME) ...

متن کامل

A structured alternative to Prolog with simple compositional semantics

Prolog's very useful expressive power is not captured by traditional logic programming semantics, due mainly to the cut and goal and clause order. Several alternative semantics have been put forward, exposing operational details of the computation state. We propose instead to redesign Prolog around structured alternatives to the cut and clauses, keeping the expressive power and computation mode...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004